-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 리액션 API 추가 및 추천리스트 API, 리스트 상세조회 API 재구현 #304
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
복잡했을텐데 구현 깔끔하네요!
일단 몇 가지 제안 드려봤습니다.
그런데 리스트 상세 조회 시 최신 댓글 정보 가져오는 변경 사항을 먼저 머지하면, 일부 수정하셔야 해서 그때 다시 보겠습니다.
고생하셨어요!
src/main/java/com/listywave/list/application/domain/reaction/Reaction.java
Outdated
Show resolved
Hide resolved
src/main/java/com/listywave/list/application/domain/reaction/ReactionStats.java
Outdated
Show resolved
Hide resolved
src/main/java/com/listywave/list/application/domain/reaction/UserReaction.java
Outdated
Show resolved
Hide resolved
src/main/java/com/listywave/list/application/service/ListService.java
Outdated
Show resolved
Hide resolved
src/main/java/com/listywave/list/presentation/controller/ListController.java
Outdated
Show resolved
Hide resolved
@Nested | ||
class 리액션_테스트 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
리액션은 리스트에서 분리하는 건 어떠신가요??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
좋습니다!
@PostMapping("/lists/{listId}/reaction") | ||
public ResponseEntity<String> handleReaction( | ||
@Auth Long loginUserId, | ||
@PathVariable("listId") Long listId, | ||
@RequestBody ReactionRequest request | ||
) { | ||
listService.handleReaction(loginUserId, listId, request.reaction()); | ||
return ResponseEntity.noContent().build(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아 그리고 리액션은 List랑 패키지 분리하는 건 어떠신가요??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
list에서만 사용해서 포함시키긴 했는데 아무래도 따로 분리하는게 나을 거 같죠?
src/main/java/com/listywave/list/application/domain/reaction/ReactionStats.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kdkdhoho 답변 부탁드립니다 ㅎㅎ
src/main/java/com/listywave/list/application/domain/reaction/Reaction.java
Outdated
Show resolved
Hide resolved
src/main/java/com/listywave/list/application/domain/reaction/ReactionStats.java
Outdated
Show resolved
Hide resolved
src/main/java/com/listywave/list/application/domain/reaction/UserReaction.java
Outdated
Show resolved
Hide resolved
src/main/java/com/listywave/list/presentation/controller/ListController.java
Outdated
Show resolved
Hide resolved
@Nested | ||
class 리액션_테스트 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
좋습니다!
@PostMapping("/lists/{listId}/reaction") | ||
public ResponseEntity<String> handleReaction( | ||
@Auth Long loginUserId, | ||
@PathVariable("listId") Long listId, | ||
@RequestBody ReactionRequest request | ||
) { | ||
listService.handleReaction(loginUserId, listId, request.reaction()); | ||
return ResponseEntity.noContent().build(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
list에서만 사용해서 포함시키긴 했는데 아무래도 따로 분리하는게 나을 거 같죠?
반영 했습니다! 그 Unique key에서 id는 기존 unique 고유 특성 있어서 빼도 된다고 하셨었는데 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
풍부한 테스트코드와 유니크 제약 조건 테스트까지.. 넘 수고하셨습니다 !
변수명 하나만 제안드립니다 ㅎ
Approve 할게요 !!
|
||
private final String name; | ||
private final String displayName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
혹시 viewName
은 어떠신가요..? ㅎ
CategoryType에서 viewName을 사용하고 있는데 통일시키는게 좋을 것 같아서요 !!
Description
🛠️변경사항
멋져요, 공감해요, 감사해요라는 리액션을 추가함
-> 언제든 리액션에 추가가 필요할 경우 쉽게 추가할 수 있도록 설계함
-> 추후 리액션 카운트 업데이트에 대한
동시성 처리
를 할 예정임리액션 추가에 의한 리스트 상세정보 API 수정함
-> 리스트 1번에 대한 어떠한 리액션을 누군가 최초로 했을 경우 그 순간
reaction_stats
테이블에 데이터가insert
되도록 함이를 통해 데이터 메모리 낭비를 방지하였음
기존 트랜딩리스트 -> 추천리스트로 명칭이 바뀌었고 이에따라 추천리스트의 정책이 변경됨에 따라 API를 수정함
-> 가장 최근에 30일간 리액션이 달렸으며 리액션 횟수의 합이 가장 높은 리스트 TOP10
만약 리액션 횟수가 같은 경우 리스트 수정일이 빠른 리스트 가져오도록 변경됨
🚨 Merge하기 전 주의!
dev
와prod
에 merge 하기 전 꼭 필수로 쿼리를 실행해 줘야함Relation Issues